package com.zsc.controller.user;

import com.zsc.entity.Category;
import com.zsc.result.Result;
import com.zsc.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 叶文锋
 * @Date 2024/6/13 18:51
 */
@RestController("userCategoryController")
@RequestMapping("/user/category")
@Api(tags = "用户端 分类接口")
@Slf4j
public class CategoryController {

    @Autowired
    private CategoryService CategoryService;

    @GetMapping("/category")
    @ApiOperation("获取菜品分类")
    public Result<List<Category>> list() {
        
        List<Category> list = CategoryService.list();
        return Result.success(list);
    }
}
